package org.example.model;

import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.GrantedAuthority;

import java.util.Collection;

/**
 * @Author: LiFuqiang
 * @Date: 2020/9/30 14:45
 * @Version 1.0
 * @description  自定义实现 Authentication 类，相比 UsernamePasswordAuthenticationToken，多了 token 字段
 */
public class UserInfoToken extends UsernamePasswordAuthenticationToken {

    private String token;

    public UserInfoToken(Object principal, Object credentials) {
        super(principal, credentials);
    }

    public UserInfoToken(Object principal, Object credentials, Collection<? extends GrantedAuthority> authorities) {
        super(principal, credentials, authorities);
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }
}
